<?php

namespace Acme\PageBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class DefaultController extends Controller {

  /**
   * @Route("/")
   * @Template()
   */
  public function indexAction($name=null) {
    $em = $this->getDoctrine()->getEntityManager();
    $categorys = $em->getRepository('AcmeStaffBundle:CategoryStaff')->findAll();
//        if (!is_null($name)) {
//            $page = $this->getDoctrine()->getRepository('AcmePageBundle:Page')->findOneByUrl($name);
//            return array('description' => $page->getDescription());
//        } else {
    return array( 'description' => '',
                  'categorys' => $categorys);
//        }
  }

}
